package com.zhang.builder02;

public class Worker extends Builder{


    private Product product;

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    public Worker(){
        product = new Product();
    }
    @Override
    Builder buildA(String msg) {
        product.setBuilderA(msg);
        return this;
    }

    @Override
    Builder buildB(String msg) {
        product.setBuilderB(msg);
        return this;
    }

    @Override
    Builder buildC(String msg) {
        product.setBuilderC(msg);
        return this;
    }

    @Override
    Builder buildD(String msg) {
        product.setBuilderD(msg);
        return this;
    }

    Product gerProduct() {
        return product;
    }

    @Override
    public String toString() {
        return "Worker{" +
                "product=" + product +
                '}';
    }
}
